<template>
  <div class="New_add">
    <div class="mask"></div>
    <div class="new_add">
      <div class="add-top">
        <p>{{ !$route.query.oid ? '新增（客户订货）' : '客户订货补单' }}</p>
        <i class="el-icon-close" @click="closeAdd"></i>
      </div>

      <div class="add-info">
        <div class="add-info-1">
          <p>配货方式</p>
          <el-select
            v-model="cooperateWay"
            class="add-inp"
            :disabled="supplement"
          >
            <el-option
              v-for="item in cooperateWayList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>

          <p>客户</p>
          <el-input
            style="width: 60px; margin-right: 10px"
            v-model="customerNo"
            @blur="customerNoBlur"
            :disabled="supplement || jxAgent"
          ></el-input>
          <el-select
            style="width: 100px"
            v-model="customerName"
            @change="
              (e) => {
                this.customerNo = e
              }
            "
            :disabled="supplement || jxAgent"
          >
            <el-option
              v-for="item in customerList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
              <span style="float: left">{{ item.value }}</span>
              <span style="float: right">{{ item.label }}</span>
            </el-option>
          </el-select>
          <p>折数</p>
          <el-input disabled class="add-inp" v-model="discount"></el-input>

          <p>实收单价</p>
          <el-input disabled class="add-inp" v-model="onePrice"></el-input>
        </div>
        <div class="add-info2">
          <p>订货日期</p>
          <el-date-picker
            :disabled="supplement"
            v-model="inputDate"
            type="date"
            value-format="yyyy-MM-dd"
            style="width: 160px"
          >
          </el-date-picker>
          <p>售价</p>
          <el-input
            disabled
            style="width: 170px"
            v-model="sellingPrice"
          ></el-input>
          <p>订货序号</p>
          <el-input disabled class="add-inp" v-model="sequence"></el-input>
          <p>单号</p>
          <el-input
            class="add-inp"
            v-model="receiptsNumber"
            :disabled="supplement"
          ></el-input>
        </div>
        <div class="add-info2">
          <p>备注</p>
          <el-input
            style="width: 425px"
            v-model="remark"
            :disabled="supplement"
          ></el-input>
        </div>

        <el-table
          id="codeTable"
          :data="codeData"
          class="tb-edit"
          border
          style="width: 100%; margin-bottom: 15px"
          max-height="148px"
          @cell-click="cellClick"
          :header-cell-style="{
            background: '#f4f4f4',
            padding: 0,
            height: '40px'
          }"
          :cell-style="{ padding: 0, height: '36px' }"
        >
          <el-table-column :label="header" width="150"> </el-table-column>
          <el-table-column prop="colorName" label="颜色" width="100">
          </el-table-column>

          <template v-for="i in sizeList">
            <el-table-column :prop="i" :label="i" :key="i + Math.random()">
              <template slot-scope="scope">
                <el-input
                  size="small"
                  class="innerInp"
                  v-model="scope.row[i]"
                  @blur="
                    handleInputBlurResult($event, {
                      index: scope.$index,
                      key: i,
                      result: scope.row[i]
                    })
                  "
                  @keyup.enter.native="inpEnter"
                >
                </el-input>
                <!-- <span>{{scope.row[i]}}</span> -->
              </template>
            </el-table-column>
          </template>
        </el-table>

        <div class="enterBarcode">
          <el-input
            ref="barcodeInput1"
            v-model="barcode"
            placeholder="输入货号或款号，输完按回车"
            @keyup.enter.native="barcodeEnter(1)"
          ></el-input>
          <el-input
            ref="barcodeInput2"
            v-model="mnemonic"
            placeholder="输入助记码，输完按回车"
            @keyup.enter.native="barcodeEnter(0)"
          ></el-input>
          <span>合计：{{ total }}</span>
        </div>

        <el-table
          height="210px"
          :data="barcodeData"
          style="width: 100%"
          :header-cell-style="{
            background: '#f4f4f4',
            padding: 0,
            height: '40px'
          }"
          :cell-style="{ padding: 0, height: '36px' }"
        >
          <el-table-column prop="kindsNumber" label="货号" width="160">
          </el-table-column>
          <el-table-column prop="colorName" label="颜色" width="80">
          </el-table-column>
          <el-table-column prop="size" label="尺码编号" width="80">
          </el-table-column>
          <el-table-column prop="number" label="数量" width="60">
          </el-table-column>
          <el-table-column prop="onePrice" label="单价"> </el-table-column>
          <el-table-column prop="money" label="金额" width="120">
          </el-table-column>
          <el-table-column prop="sellingPrice" label="售价"> </el-table-column>
          <el-table-column prop="commodityName" label="品名" width="100">
          </el-table-column>
          <el-table-column prop="brandedName" label="品牌" width="100">
          </el-table-column>
          <el-table-column prop="entryTime" label="录入时间" width="160">
          </el-table-column>
        </el-table>
      </div>

      <div class="add-btn">
        <div style="margin: 5px 20px 10px 0">
          <el-button @click="closeAdd">取消</el-button>
          <el-button @click="Save" type="primary" plain>保存</el-button>
          <el-button @click="ContinueInput" type="primary">继续录入</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {
  select,
  continueInput,
  save
} from '../../../../network/customerOrderTotal'
import { getKindsNumberList, getArtNo } from '../../../../network/artNo'
import { getBarCode } from '../../../../network/manufacturer'

export default {
  props: {
    sendData: {
      type: Object,
      default: {}
    },
    customerL: {
      type: Array,
      default: []
    },
    pageSession: {
      type: String,
      default: ''
    },
    flag: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      jxAgent:
        document.cookie.match(RegExp('jxAgent' + '=([^;]+)'))[1] == 1
          ? true
          : false,
      manufacturerBarCode: {},
      originalData: {},
      kindsNumberMap: {},
      sequence: '',
      cooperateWay: '',
      cooperateWayList: [
        { value: '配货', label: '配货' },
        { value: '订货', label: '订货' },
        { value: '订断', label: '订断' },
        { value: '追断', label: '追断' }
      ],
      customerNo: '',
      customerName: '',
      customerList: [],
      discount: '',
      onePrice: '',
      inputDate: '',
      sellingPrice: '',
      receiptsNumber: '',
      remark: '',

      barcode: '',
      mnemonic: '',

      header: '',
      sizeList: [''],
      codeData: [],
      barcodeData: [],
      supplement: false,
      total: 0
    }
  },
  watch: {
    customerL(a, b) {
      this.customerList = a
    },
    // 数据不清理，是应该这里有监听
    sendData(a, b) {
      this.sequence = a.sequence
      this.inputDate = a.inputDate
      this.customerNo = a.customerNo
      this.customerName = a.customerName
      this.cooperateWay = a.cooperateWay
      this.remark = a.remark
    },
    flag(a, b) {
      if (a) {
        if (this.$route.query.oid) {
          this.supplement = true
          select({ orderSequence: this.sequence }).then((res) => {
            this.barcodeData = []
            this.total = 0
            this.kindsNumberMap = {}
            res.data.data.customerOrderVOListInfo.forEach((e) => {
              this.total += Number(e.number)
              this.kindsNumberMap[e.kindsNumber] = e.number
              e.orderTime = e.orderTime.slice(0, 10)
              e.entryTime = e.enteringTime
              this.barcodeData.push(e)
            })
            this.fillBlanks(res.data.data.customerOrderVOListInfo[0] || {})
          })
        } else {
          this.supplement = false
          this.sequence = ''
        }
      }
    },
    customerNo(a, b) {
      this.customerNo = a.toUpperCase().trim()
    },
    receiptsNumber(a, b) {
      this.receiptsNumber = a.toUpperCase().trim()
    },
    barcode(a, b) {
      this.barcode = a.toUpperCase().trim()
    },
    mnemonic(a, b) {
      this.mnemonic = a.toUpperCase().trim()
    }
  },

  methods: {
    sibling(e) {
      let s = []
      let pp = e.parentNode.parentNode.children
      console.log(pp)
      for (let j = 0; j < pp.length; j++) {
        let p = pp[j].children
        for (let i = 0, pl = p.length; i < pl; i++) {
          if (p[i] !== e) s.push(p[i])
        }
      }
      return s
    },
    handleInputBlurResult(e, { index, key, result }) {
      e.target.parentNode.parentNode.parentNode.classList.remove('activeCell')
      let r = /^(0|[1-9][0-9]*|-[1-9][0-9]*)$/
      if (result != 0) {
        result = result.replace(/\b(0+)/gi, '')
      }
      if (!r.test(result) && result) {
        this.$alert('数量请输入整数', '', {
          confirmButtonText: '确定'
        })
        this.codeData[index][key] = 0
        return
      }
      this.codeData[index][key] = result
    },
    cellClick(row, column, cell, event) {
      cell.classList.add('activeCell')
      let s = this.sibling(cell)
      // console.log(s)
      s.forEach((e) => {
        e.classList.remove('activeCell')
      })
    },
    inpEnter(e) {
      e.target.parentNode.parentNode.parentNode.classList.remove('activeCell')
    },

    barcodeEnter(a) {
      if (a && this.barcode) {
        // 手输型货号
        getKindsNumberList({ kindsNumberStr: this.barcode }).then((res) => {
          if (res.data.data.data.length) {
            this.header = res.data.data.data[0].styleNumber
            this.$emit('inpNumChange')
            if (res.data.data.data.length) {
              this.discount = res.data.data.data[0].discount
              this.sellingPrice = res.data.data.data[0].sellingPrice
              this.onePrice =
                (res.data.data.data[0].discount *
                  res.data.data.data[0].sellingPrice) /
                10
            }
            // 品牌公司查条码规律详情
            getBarCode({ company: res.data.data.data[0].brandedCompany }).then(
              (res) => {
                // console.log(res)
                this.manufacturerBarCode = res.data.data[0]
              }
            )
            // console.log(this.manufacturerBarCode)
            // 输入款号显示中间表和尺码信息   ZZZ-AAS
            res.data.data.data.sort((a, b) => {
              return a.relevanceSize.localeCompare(b.relevanceSize)
            })
            let tmp = res.data.data.data
            this.tmpBarcodeData = tmp
            // console.log(tmp)

            // 中间表  尺码表头
            this.sizeList = [tmp[0].size]
            let isExistSize = 0
            for (const i of tmp) {
              for (const j of this.sizeList) {
                if (j == i.size) {
                  isExistSize = 0
                  break
                }
                isExistSize = 1
              }
              if (isExistSize) {
                this.sizeList.push(i.size)
              }
            }

            // 中间表
            let tmpCodeData = [
              { colorNo: tmp[0].colorNo, colorName: tmp[0].colorName }
            ]
            let isExistColor = 0
            for (const i of tmp) {
              for (const j of tmpCodeData) {
                if (j.colorName == i.colorName) {
                  isExistColor = 0
                  break
                }
                isExistColor = 1
              }
              if (isExistColor) {
                tmpCodeData.push({ colorNo: i.colorNo, colorName: i.colorName })
              }
            }
            tmpCodeData.forEach((e) => {
              this.sizeList.forEach((f) => {
                e[f] = ''
              })
            })
            this.codeData = tmpCodeData
            let codeTable = document.getElementById('codeTable')
            let inputs = codeTable.getElementsByTagName('input')
            // console.log(inputs)
            let int = setInterval(() => {
              clearInterval(int)
              inputs[0].focus()
              inputs[inputs.length - 1].onkeyup = (e) => {
                if (window.event.keyCode == 13) {
                  this.ContinueInput()
                  inputs[inputs.length - 1].onkeyup = () => {}
                }
              }
            }, 100)
          } else {
            this.$message('此货号/款号无数据')
          }
        })
      }
      if (!a && this.mnemonic) {
        // 输入助记码
        getArtNo({
          mnemonicCode: this.mnemonic,
          pageSize: 9999,
          groupType: 1
        }).then((res) => {
          if (res.data.code == 200) {
            this.$refs.barcodeInput2.focus()
            if (res.data.data.length) {
              this.header = res.data.data[0].styleNumber
              this.discount = res.data.data[0].discount
              this.sellingPrice = res.data.data[0].sellingPrice
              this.onePrice =
                (res.data.data[0].discount * res.data.data[0].sellingPrice) / 10
            }
            // 品牌公司查条码规律详情
            getBarCode({ company: res.data.data[0].brandedCompany }).then(
              (res) => {
                this.manufacturerBarCode = res.data.data[0]
              }
            )
            // console.log(this.manufacturerBarCode)
            // 输入款号显示中间表和尺码信息   ZZZ-AAS
            let tmp = res.data.data
            this.tmpBarcodeData = tmp
            // console.log(tmp)

            // 中间表  尺码表头
            this.sizeList = [tmp[0].size]
            let isExistSize = 0
            for (const i of tmp) {
              for (const j of this.sizeList) {
                if (j == i.size) {
                  isExistSize = 0
                  break
                }
                isExistSize = 1
              }
              if (isExistSize) {
                this.sizeList.push(i.size)
              }
            }

            // 中间表
            let tmpCodeData = [
              { colorNo: tmp[0].colorNo, colorName: tmp[0].colorName }
            ]
            let isExistColor = 0
            for (const i of tmp) {
              for (const j of tmpCodeData) {
                if (j.colorName == i.colorName) {
                  isExistColor = 0
                  break
                }
                isExistColor = 1
              }
              if (isExistColor) {
                tmpCodeData.push({ colorNo: i.colorNo, colorName: i.colorName })
              }
            }
            tmpCodeData.forEach((e) => {
              this.sizeList.forEach((f) => {
                e[f] = ''
              })
            })
            this.codeData = tmpCodeData
          }
        })
      }
    },

    ContinueInput() {
      if (!this.inputDate) {
        this.$alert('日期不能为空', '', {
          confirmButtonText: '确定'
        })
        return
      }
      if (!this.customerNo) {
        this.$alert('客户不能为空', '', {
          confirmButtonText: '确定'
        })
        return
      }

      // 是否有信息变动
      let isNew = false

      if (JSON.stringify(this.originalData) == '{}') {
        // 第一次，记录原始数据
        this.originalData.inputDate = this.inputDate
        this.originalData.customerNo = this.customerNo
        this.originalData.cooperateWay = this.cooperateWay
        this.originalData.receiptsNumber = this.receiptsNumber
        this.originalData.remark = this.remark
      } else {
        // 判断是否修改了数据
        for (const key in this.originalData) {
          if (this.originalData.hasOwnProperty(key)) {
            const e = this.originalData[key]
            if (e != this[key]) {
              // 修改了数据 重新赋值
              isNew = true
              this.originalData.inputDate = this.inputDate
              this.originalData.customerNo = this.customerNo
              this.originalData.cooperateWay = this.cooperateWay
              this.originalData.receiptsNumber = this.receiptsNumber
              this.originalData.remark = this.remark
              break
            }
          }
        }
      }

      let validList = []
      if (this.sequence != '' && !isNew) {
        // 有序号并且信息没改，再点读卡，传右表
        // console.log('没有数据变动')
        validList = this.kindsNumberList
      } else {
        // console.log('第一次或有数据变动')
        // 有数据变动，进厂序号改空
        this.sequence = ''
        this.barcodeData = []
        this.total = 0
      }

      let kindsNumberNumMap = {}

      let knList = []
      this.codeData.forEach((e) => {
        let c = e.colorNo
        this.sizeList.forEach((f) => {
          if (this.manufacturerBarCode.styleColorSize) {
            // 型尺色

            if (this.manufacturerBarCode.styleColor) {
              // 款号与尺码之间有 -

              if (this.manufacturerBarCode.colorSize) {
                // 色号与尺码之间有 -
                knList.push({
                  kindsNumber: `${this.header}-${f}-${c}`,
                  sum: e[f]
                })
              } else {
                // 色号与尺码之间没有 -
                knList.push({
                  kindsNumber: `${this.header}-${f}${c}`,
                  sum: e[f]
                })
              }
            } else {
              // 款号与尺码之间没有 -

              if (this.manufacturerBarCode.colorSize) {
                // 色号与尺码之间有 -
                knList.push({
                  kindsNumber: `${this.header}${f}-${c}`,
                  sum: e[f]
                })
              } else {
                // 色号与尺码之间没有 -
                knList.push({
                  kindsNumber: `${this.header}${f}${c}`,
                  sum: e[f]
                })
              }
            }
          } else {
            // 型色尺

            if (this.manufacturerBarCode.styleColor) {
              // 款号与颜色之间有 -

              if (this.manufacturerBarCode.colorSize) {
                // 色号与尺码之间有 -
                knList.push({
                  kindsNumber: `${this.header}-${c}-${f}`,
                  sum: e[f]
                })
              } else {
                // 色号与尺码之间没有 -
                knList.push({
                  kindsNumber: `${this.header}-${c}${f}`,
                  sum: e[f]
                })
              }
            } else {
              // 款号与颜色之间没有 -

              if (this.manufacturerBarCode.colorSize) {
                // 色号与尺码之间有 -
                knList.push({
                  kindsNumber: `${this.header}${c}-${f}`,
                  sum: e[f]
                })
              } else {
                // 色号与尺码之间没有 -
                knList.push({
                  kindsNumber: `${this.header}${c}${f}`,
                  sum: e[f]
                })
              }
            }
          }
        })
      })
      // console.log(knList)
      if (!knList.length) {
        this.$alert('无数据无法继续录入', '', {
          confirmButtonText: '确定'
        })
        return
      }
      for (const i of knList) {
        if (i.sum == '' || i.sum == 0) continue
        kindsNumberNumMap[i.kindsNumber] = i.sum
      }
      let d = {
        orderTime: this.inputDate,
        // orderTime: '2020-12-22',
        customerNo: this.customerNo,
        orderSequence: this.sequence,
        cooperateWay: this.cooperateWay,
        receiptsNumber: this.receiptsNumber,
        remark: this.remark,
        kindsNumberNumMap
      }
      // console.log(d)
      // return
      continueInput(JSON.stringify(d)).then((res) => {
        if (res.data.code == 200) {
          this.barcode = ''
          this.header = ''
          this.$refs.barcodeInput1.focus()
          this.codeData = []
          if (res.data.data && res.data.data.length) {
            this.sequence = res.data.data[0].sequence
            let isExist = 0
            res.data.data.forEach((e) => {
              e.number = e.sum
              this.total += Number(e.sum)
              for (const i of this.barcodeData) {
                if (e.kindsNumber == i.kindsNumber) {
                  i.number += Number(e.sum)
                  i.money = (i.number * i.onePrice).toFixed(2)
                  isExist = 1
                  break
                }
                isExist = 0
              }
              if (!isExist) {
                this.barcodeData.unshift(e)
              }
            })
          }
        }
      })
    },

    Save() {
      if (!this.inputDate) {
        this.$alert('日期不能为空', '', {
          confirmButtonText: '确定'
        })
        return
      }
      if (!this.customerNo) {
        this.$alert('客户不能为空', '', {
          confirmButtonText: '确定'
        })
        return
      }

      // 货号：数量 map集合
      let kindsNumberNumMap = {}
      // 补单新货号对象集合
      let replenishmentNewKindsNumberMap = {}

      this.barcodeData.forEach((e) => {
        e.sum = e.number
        e.orderSalesSequence = this.sequence
        replenishmentNewKindsNumberMap[e.kindsNumber] = e
        kindsNumberNumMap[e.kindsNumber] = e.number
      })

      if (this.sequence) {
        // 补单
        for (const i in this.kindsNumberMap) {
          for (const k in kindsNumberNumMap) {
            if (kindsNumberNumMap.hasOwnProperty(k)) {
              if (i == k) {
                // delete kindsNumberNumMap[k]
                delete replenishmentNewKindsNumberMap[k]
                break
              }
            }
          }
        }
      }

      let validList = []
      this.barcodeData.forEach((e) => {
        for (const key in this.kindsNumberMap) {
          if (key == e.kindsNumber) {
            e.sequence = this.sequence
            validList.push(e)
            break
          }
        }
      })

      let d = {
        customerDTO: {
          pageSession: this.pageSession,
          // 是否是补单（补货数据（0否 1是））
          isReplenishment: this.$route.query.oid ? 1 : 0,
          // orderTime: this.inputDate + '\xa0' + '00:00:00',
          orderTime: this.inputDate,
          customerNo: this.customerNo,
          sequence: this.sequence,
          cooperateWay: this.cooperateWay,
          receiptsNumber: this.receiptsNumber,
          remark: this.remark,
          kindsNumberNumMap,
          replenishmentNewKindsNumberMap
        },
        validList: this.$route.query.oid ? validList : this.barcodeData
      }
      // console.log(d)
      // return
      save(JSON.stringify(d)).then((res) => {
        if (res.data.code == 200) {
          this.$message({
            message: '保存成功',
            type: 'success'
          })
          let send = {
            inputDate: this.inputDate,
            customerNo: this.customerNo,
            customerName: this.customerName,
            sequence: this.sequence,
            cooperateWay: this.cooperateWay,
            receiptsNumber: this.receiptsNumber,
            remark: this.remark
          }
          // 发送到父组件数据
          this.$emit('saveNew', send)
          this.header = ''
          this.codeData = []
          this.barcodeData = []
          this.total = 0
          this.originalData = {}
          this.closeAdd()
        } else {
          this.$message.error('保存失败')
        }
      })
    },

    closeAdd() {
      this.$emit('closeAdd')
      // this.discount = ''
      // this.sequence = ''
      // this.onePrice = ''
      // this.receiptsNumber = ''
      this.header = ''
      this.codeData = []
      this.barcodeData = []
      this.total = 0
      this.originalData = {}
    },
    saveAdd() {
      this.$emit('saveAdd')
    },

    // 客户编号失去焦点
    customerNoBlur() {
      if (this.customerNo != '') {
        for (const i of this.customerList) {
          if (this.customerNo == i.value) {
            this.customerName = i.label
            return
          }
        }
        this.$alert('无此客户编号', '', {
          confirmButtonText: '确定'
        })
        this.customerNo = ''
        this.customerName = ''
      } else {
        this.customerName = ''
      }
    },

    fillBlanks(obj) {
      this.customerNo = obj.customerNo
      this.inputDate = obj.orderTime.slice(0, 10)
      this.cooperateWay = obj.cooperateWay
      this.remark = obj.remark
      this.discount = obj.discount
      this.receiptsNumber = obj.receiptsNumber

      this.customerNoBlur()
    }
  }
}
</script>

<style scoped>
.middle {
  padding: 10px 15px;
}
.middle p {
  padding-bottom: 10px;
}
._top {
  display: flex;
  width: 100%;
  height: 40px;
  padding: 10px 15px;
  justify-content: space-between;
  background: #f8f8f8;
  font-weight: 700;
}
/* 新建资料 */
.mask {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: 0.3;
  z-index: 9;
}
.new_add {
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 1070px;
  z-index: 99;
  background-color: white;
  overflow: auto;
}
.new_add .add-top {
  height: 40px;
  background-color: #f8f8f8;
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
}
.add-top p {
  font-weight: 700;
}

.new_add input {
  height: 30px;
  border: buildlid 1px #dcdfe6;
  border-radius: 5px;
  margin-left: 10px;
}
.new_add input:focus {
  outline: none;
  border: buildlid 1px #409eff;
}

.add-info {
  padding: 0 15px;
  padding-bottom: 10px;
  /* border-bottom: buildlid #f2f2f2 2px; */
}
.add-info-1 p {
  display: inline-block;
  width: 80px;
  text-align: right;
  margin-right: 15px;
}
.add-info2 {
  display: flex;
  margin: 10px 0;
}
.add-info2 p {
  display: inline-block;
  width: 80px;
  text-align: right;
  margin-right: 15px;
}

.colorBox,
.infoBox {
  display: inline;
}

.enterBarcode {
  height: 60px;
  background-color: #f2f2f2;
  margin: 15px 0;
}

.add-btn {
  text-align: right;
}
.popup {
  width: 400px;
  height: 200px;
  border: 1px solid #dbdbdb;
  box-shadow: 0 2px 2px 2px #dbdbdb;
  z-index: 999;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -100px 0 0 -200px;
  background: white;
  /* display: block; */
}
.popup_t {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 40px;
  background: rgb(244, 244, 244);
  padding: 8px 15px;
}
.popup_t p {
  font-weight: 700;
}
.popup_c {
  padding: 8px 15px;
}
.popup_button {
  margin: 5px 0 0 0;
  width: 94%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid#dbdbdb;
  border-radius: 3px;
}
.popup_b {
  margin: 10px 0 0 0;
  padding-left: 230px;
}
.add-inp {
  width: 160px;
}
</style>

<style>
.new_add .add-info-4 .el-table .cell {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-all;
  line-height: 41px;
  padding-right: 10px;
  height: 40px;
}
.new_add .add-info-4 .el-input__inner {
  border: 0px;
}
.new_add .add-info-4 .el-input__inner:focus {
  border: 1px solid #017aff;
}

/* .new_add .add-info-1 .el-input, .new_add .add-info-3 .el-input{
    width: 425px;
  } */
.new_add .add-info-1 .el-input,
.new_add .add-info-2 .el-input {
  margin-top: 10px;
  /* width: 160px; */
}
.new_add .el-input__inner {
  height: 30px !important;
}
.new_add .el-input__icon {
  line-height: 30px !important;
}
.add-info .barcode .el-switch {
  margin: 0 !important;
}

.new_add .enterBarcode .el-input {
  width: 400px;
  margin: 14px 17px;
}
</style>
